home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / 80x0393.zip / DMAPORTS.TXT < prev    next >
Text File  |  1992-09-30  |  9KB  |  166 lines

  1. ────────────────────────────────────────────────────────────────────────────────
  2. From : Inbar Raz
  3.  
  4. Port  Description
  5. ▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  6. 000H-01fH DMA (Direct Memory Access) controller        See DMA Ports
  7.  
  8. 020H-03fH Interrupt Controller
  9.  
  10. ==============================================================================
  11.  
  12.  DMA (Direct Memory Access) is used for high-speed data transfers between I/O
  13.  devices and memory without intervention of the CPU.  It is typically employed
  14.  by diskette and hard disk drivers, but it could be used for streaming tape or
  15.  any other device as long as it does not interfere with the operation of other
  16.  standard devices.
  17.  
  18.  The original PC supports four 8-bit DMA channels, across a 20-bit address
  19.  space, using an Intel 8237A DMA controller chip.  The ▌AT▐ supports 7 DMA
  20.  channels by cascading a second 8237A DMA controller.  The differences between
  21.  PC and AT DMA are covered at the end of this section.
  22.  
  23. Channel  Usage in PC and XT
  24. ▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  25.    0     memory refresh    (highest priority)
  26.    1     not used
  27.    2     diskette adapter
  28.    3     hard disk adapter (lowest priority)
  29.  
  30. Port  Description
  31. ▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  32. 000H-007H DMA base address an offset registers
  33.        All are 16-bit registers: read/write the low byte, then the high byte
  34.        at the same I/O port.  Base addresses are offsets from a DMA Page (see
  35.        below).
  36.  
  37. 000H  Write: DMA channel 0 base address (also sets current address)
  38.       Read:  DMA channel 0 current address
  39. 001H  Write: DMA channel 0 base address and word count
  40.       Read:  DMA channel 0 current word count
  41. 002H  Write: DMA channel 1 base address
  42.       Read:  DMA channel 1 current address
  43. 003H  Write: DMA channel 1 base address and word count
  44.       Read:  DMA channel 1 current word count
  45. 004H  Write: DMA channel 2 base address                (diskette adapter)
  46.       Read:  DMA channel 2 current address              "
  47. 005H  Write: DMA channel 2 base address and word count  "
  48.       Read:  DMA channel 2 current word count           "
  49. 006H  Write: DMA channel 3 base address                (hard disk adapter)
  50.       Read:  DMA channel 3 current address              "
  51. 007H  Write: DMA channel 3 base address and word count  "
  52.       Read:  DMA channel 3 current word count           "
  53. ■■■■  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  54. 008H-00fH DMA control/status registers
  55. 008H  Write: DMA command register
  56.       ╓7┬6┬5┬4┬3┬2┬1┬0╖
  57.       ║ │ │ │ │ │ │ │ ║
  58.       ╙╥┴╥┴╥┴╥┴╥┴╥┴╥┴╥╜ bit
  59.        ║ ║ ║ ║ ║ ║ ║ ╚═ 0: 1=enable memory-to-memory DMA (ch0═ch1)
  60.        ║ ║ ║ ║ ║ ║ ╚═══ 1: 1=enable Ch0 address hold
  61.        ║ ║ ║ ║ ║ ╚═════ 2: 1=disable controller
  62.        ║ ║ ║ ║ ╚═══════ 3: 1=select compressed timing mode
  63.        ║ ║ ║ ╚═════════ 4: 1=enable rotating priority
  64.        ║ ║ ╚═══════════ 5: 1=select extended write mode; 0=late write
  65.        ║ ╚═════════════ 6: 1=select DRQ sensing as active high; 0=low
  66.        ╚═══════════════ 7: 1=select DACK sensing as active high; 0=low
  67.       Read:  DMA status register
  68.       ╓7┬6┬5┬4┬3┬2┬1┬0╖
  69.       ║ │ │ │ │ │ │ │ ║
  70.       ╙─┴─┴─┴─┴─┴─┴─┴─╜ bit
  71.        ╚══╦══╝ ╚═════╩═ 0-3: channel 0-3 has reached terminal count
  72.           ╚════════════ 4-7: channel 0-3 has a request pending
  73. 009H  Write: request register
  74.       ╓7┬6┬5┬4┬3┬2┬1┬0╖
  75.       ║  unused │ │   ║
  76.       ╙─┴─┴─┴─┴─┴╥┴─┴─╜ bit
  77.                  ║ ╚═╩═ 0-1: select channel (00=0; 01=1; 10=2; 11=3)
  78.                  ╚═════ 2: 1=set request bit for channel; 0=reset request
  79. 00aH  Write: single mask bit register
  80.       ╓7┬6┬5┬4┬3┬2┬1┬0╖
  81.       ║  unused │ │   ║
  82.       ╙─┴─┴─┴─┴─┴╥┴─┴─╜ bit
  83.                  ║ ╚═╩═ 0-1: select channel (00=0; 01=1; 10=2; 11=3)
  84.                  ╚═════ 2: 1=set mask for channel; 0=clear mask (enable)
  85. 00bH  Write: mode register
  86.       ╓7┬6┬5┬4┬3┬2┬1┬0╖
  87.       ║ │ │ │ │ │ │ │ ║
  88.       ╙─┴─┴╥┴╥┴─┴─┴─┴─╜ bit
  89.        ╚╦╝ ║ ║ ╚╦╝ ╚═╩═ 0-1: select channel (00=0; 01=1; 10=2; 11=3)
  90.         ║  ║ ║  ╚══════ 2-3: transfer type (00=verify=Nop; 01=write; 10=read)
  91.         ║  ║ ╚═════════ 4: 1=enable auto-initialization
  92.         ║  ╚═══════════ 5: 1=select address increment; 0=address decrement
  93.         ╚══════════════ 6-7: 00=demand mode; 01=single; 10=block; 11=cascade
  94.  
  95. 00cH  Write: clear byte pointer flip-flop.  Any write clears the flip-flop so
  96.              that the next write to any of the 16-bit registers is decoded as
  97.              the low byte.  The next is the high byte, then next is low, etc.
  98.  
  99. 00dH  Write: master clear.  Any OUT clears the ctrlr (must be re-initialized)
  100.       Read:  temporary reg.  Last byte in memory-to-memory xfer (not used)
  101.  
  102. 00eH  Write: Clear mask registers.  Any OUT enables all 4 channels.
  103.  
  104. 00fH  Write: master clear.  Clear or mask any or all of the channels.
  105.       ╓7┬6┬5┬4┬3┬2┬1┬0╖
  106.       ║       │ │ │ │ ║
  107.       ╙─┴─┴─┴─┴╥┴╥┴╥┴╥╜ bit
  108.                ║ ║ ║ ╚═ 0: 1=mask channel 0; 0=enable
  109.                ║ ║ ╚═══ 1: 1=mask channel 1;
  110.                ║ ╚═════ 2: 1=mask channel 2;
  111.                ╚═══════ 3: 1=mask channel 3;
  112.       Read:  temporary reg.  Last byte in memory-to-memory xfer (not used)
  113.  
  114. ■■■■  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  115. 081H-08fH DMA page registers.
  116.       To select a starting address for a DMA operation, do an OUT to the page
  117.       register (ports 81H-83H) for the selected channel then set the base
  118.       address (ports 00H-07H) for the channel.  A page register is set with a
  119.       4-bit value that represents bits 16-19 of the 20-bit DMA address.  Since
  120.       the current address is a 16-bit value, it is not possible to cross a 64K
  121.       boundary (eg, address 1000:0, 2000:0, etc.) with a DMA operation.
  122.  
  123. 081H  Channel 2 page register  (diskette DMA)
  124. 082H  Channel 3 page register  (hard disk DMA)
  125. 083H  Channel 1 page register
  126.  
  127. ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  128. ┌─────────┐
  129. │▌AT▐ DMA │ The DMA system on the AT is basically upwardly-compatible with PC
  130. └─────────┘ and XT DMA.  In addition to the four 8-bit channels of the PC, the
  131.  AT adds a second 8237A-5 DMA controller which supports channels 4-7.
  132.  
  133. Channel  Usage in AT
  134. ▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  135.    0     spare                                   ─┐
  136.    1     SDLC (Synchronous Data Link Control)     ╞═ 8-bit DMA channels
  137.    2     diskette adapter                         │                           │
  138.    3     hard disk adapter                       ─┘                           │
  139.    4     (controller 2) cascade for controller 1 ─┐                           │
  140.    5     spare                                    ╞═ 16-bit DMA channels      │
  141.    6     spare                                    │                           │
  142.    7     spare                                   ─┘                           │
  143.                                                                               │
  144. ■■■■  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■│
  145. 081H-08fH DMA page registers.  On the AT, all 8 bits of the Page registers are│
  146.       used.  They become the high 8-bits of a 24-bit address space (with the  │
  147.       low 16-bits being set in a channel's base/current address register).    │
  148.       The page size is 128K (64K words) so DMA transfers must not cross a 128K│
  149.       boundary (eg, address 2000:0, 4000:0, 6000:0, etc.)                     │
  150.                                                                               │
  151. 081H  Channel 2 page register  (diskette DMA)  (address bits 16-23)           │
  152. 082H  Channel 3 page register  (hard disk DMA) (address bits 16-23)           │
  153. 083H  Channel 1 page register                  (address bits 16-23)           │
  154. 087H  Channel 0 page register                  (address bits 16-23)           │
  155. 089H  Channel 6 page register  (address bits 17-23)                           │
  156. 08bH  Channel 5 page register  (address bits 17-23)